namespace = cr_orthodox_pilgrimage

########################################
# Vow and destination selection
########################################

long_character_event = {
	id = cr_orthodox_pilgrimage.1
	title = CR_ORTHODOX_PILGRIMAGE_1_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_1_DESC
	picture = GFX_cr_evt_pilgrims_epic_journey
	border = GFX_event_long_frame_religion
	is_triggered_only = yes

	option = {
		name = CR_ORTHODOX_PILGRIMAGE_1_A
		long_character_event = { id = cr_orthodox_pilgrimage.2 }
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.2
	title = CR_ORTHODOX_PILGRIMAGE_2_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_2_DESC
	picture = GFX_cr_evt_pilgrims_epic_journey
	border = GFX_event_long_frame_religion
	is_triggered_only = yes

	option = {
		name = CR_ORTHODOX_PILGRIMAGE_JERUSALEM
		cr_pilgrimage_clear_destination_flags_effect = yes
		set_character_flag = cr_orthodox_pilgrimage_active
		set_character_flag = cr_pilgrimage_to_jerusalem
		set_character_flag = preparing_pilgrimage
		long_character_event = { id = cr_orthodox_pilgrimage.4 }
		ai_chance = { factor = 35 }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_CONSTANTINOPLE
		cr_pilgrimage_clear_destination_flags_effect = yes
		set_character_flag = cr_orthodox_pilgrimage_active
		set_character_flag = cr_pilgrimage_to_constantinople
		set_character_flag = preparing_pilgrimage
		long_character_event = { id = cr_orthodox_pilgrimage.4 }
		ai_chance = { factor = 40 modifier = { factor = 2 culture = greek } }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_ANTIOCH
		cr_pilgrimage_clear_destination_flags_effect = yes
		set_character_flag = cr_orthodox_pilgrimage_active
		set_character_flag = cr_pilgrimage_to_antioch
		set_character_flag = preparing_pilgrimage
		long_character_event = { id = cr_orthodox_pilgrimage.4 }
		ai_chance = { factor = 25 }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_MORE
		long_character_event = { id = cr_orthodox_pilgrimage.3 }
		ai_chance = { factor = 30 }
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.3
	title = CR_ORTHODOX_PILGRIMAGE_3_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_3_DESC
	picture = GFX_cr_evt_pilgrims_epic_journey
	border = GFX_event_long_frame_religion
	is_triggered_only = yes

	option = {
		name = CR_ORTHODOX_PILGRIMAGE_ROME
		cr_pilgrimage_clear_destination_flags_effect = yes
		set_character_flag = cr_orthodox_pilgrimage_active
		set_character_flag = cr_pilgrimage_to_rome
		set_character_flag = preparing_pilgrimage
		long_character_event = { id = cr_orthodox_pilgrimage.4 }
		ai_chance = { factor = 45 }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_ALEXANDRIA
		cr_pilgrimage_clear_destination_flags_effect = yes
		set_character_flag = cr_orthodox_pilgrimage_active
		set_character_flag = cr_pilgrimage_to_alexandria
		set_character_flag = preparing_pilgrimage
		long_character_event = { id = cr_orthodox_pilgrimage.4 }
		ai_chance = { factor = 45 }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_CANCEL
		cr_pilgrimage_clear_journey_effect = yes
		ai_chance = { factor = 10 }
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.4
	title = CR_ORTHODOX_PILGRIMAGE_4_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_4_DESC
	picture = GFX_cr_evt_pilgrims_epic_journey
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = {
		has_character_flag = preparing_pilgrimage
		has_character_flag = cr_orthodox_pilgrimage_active
	}

	option = {
		name = CR_ORTHODOX_PILGRIMAGE_4_A
		cr_pilgrimage_begin_journey_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_4_B
		trigger = { ai = no wealth = 25 }
		wealth = -25
		cr_pilgrimage_begin_journey_effect = yes
		cr_pilgrimage_spawn_ship_effect = yes
	}
}

########################################
# Five sees
########################################

long_character_event = {
	id = cr_orthodox_pilgrimage.10
	title = CR_ORTHODOX_PILGRIMAGE_10_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_10_DESC
	picture = GFX_cr_evt_pilgrimage_arrival
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_outbound }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = { name = CR_ORTHODOX_PILGRIMAGE_10_A cr_pilgrimage_resolve_learning_effect = yes cr_orthodox_finish_jerusalem_effect = yes }
	option = { name = CR_ORTHODOX_PILGRIMAGE_10_B cr_pilgrimage_resolve_diplomacy_effect = yes cr_orthodox_finish_jerusalem_effect = yes }
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_10_C
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		cr_pilgrimage_resolve_sacred_intimacy_effect = yes
		cr_orthodox_finish_jerusalem_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_10_D
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		cr_orthodox_finish_jerusalem_effect = yes
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.11
	title = CR_ORTHODOX_PILGRIMAGE_11_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_11_DESC
	picture = GFX_cr_evt_pilgrimage_arrival
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_outbound }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = { name = CR_ORTHODOX_PILGRIMAGE_11_A cr_pilgrimage_resolve_learning_effect = yes cr_orthodox_finish_constantinople_effect = yes }
	option = { name = CR_ORTHODOX_PILGRIMAGE_11_B cr_pilgrimage_resolve_diplomacy_effect = yes cr_orthodox_finish_constantinople_effect = yes }
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_11_C
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		cr_pilgrimage_resolve_sacred_intimacy_effect = yes
		cr_orthodox_finish_constantinople_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_11_D
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		cr_orthodox_finish_constantinople_effect = yes
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.12
	title = CR_ORTHODOX_PILGRIMAGE_12_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_12_DESC
	picture = GFX_cr_evt_pilgrimage_arrival
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_outbound }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = { name = CR_ORTHODOX_PILGRIMAGE_12_A cr_pilgrimage_resolve_learning_effect = yes cr_orthodox_finish_antioch_effect = yes }
	option = { name = CR_ORTHODOX_PILGRIMAGE_12_B cr_pilgrimage_resolve_stewardship_effect = yes cr_orthodox_finish_antioch_effect = yes }
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_12_C
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		cr_pilgrimage_resolve_sacred_intimacy_effect = yes
		cr_orthodox_finish_antioch_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_12_D
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		cr_orthodox_finish_antioch_effect = yes
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.13
	title = CR_ORTHODOX_PILGRIMAGE_13_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_13_DESC
	picture = GFX_cr_evt_pilgrimage_arrival
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_outbound }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = { name = CR_ORTHODOX_PILGRIMAGE_13_A cr_pilgrimage_resolve_learning_effect = yes cr_orthodox_finish_rome_effect = yes }
	option = { name = CR_ORTHODOX_PILGRIMAGE_13_B cr_pilgrimage_resolve_diplomacy_effect = yes cr_orthodox_finish_rome_effect = yes }
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_13_C
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		cr_pilgrimage_resolve_sacred_intimacy_effect = yes
		cr_orthodox_finish_rome_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_13_D
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		cr_orthodox_finish_rome_effect = yes
	}
}

long_character_event = {
	id = cr_orthodox_pilgrimage.14
	title = CR_ORTHODOX_PILGRIMAGE_14_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_14_DESC
	picture = GFX_cr_evt_pilgrimage_arrival
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_outbound }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = { name = CR_ORTHODOX_PILGRIMAGE_14_A cr_pilgrimage_resolve_learning_effect = yes cr_orthodox_finish_alexandria_effect = yes }
	option = { name = CR_ORTHODOX_PILGRIMAGE_14_B cr_pilgrimage_resolve_intrigue_effect = yes cr_orthodox_finish_alexandria_effect = yes }
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_14_C
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		cr_pilgrimage_resolve_sacred_intimacy_effect = yes
		cr_orthodox_finish_alexandria_effect = yes
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_14_D
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		cr_orthodox_finish_alexandria_effect = yes
	}
}

########################################
# Homecoming
########################################

long_character_event = {
	id = cr_orthodox_pilgrimage.20
	title = CR_ORTHODOX_PILGRIMAGE_20_TITLE
	desc = CR_ORTHODOX_PILGRIMAGE_20_DESC
	picture = GFX_cr_evt_pilgrims_epic_journey
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	trigger = { has_character_flag = cr_orthodox_pilgrimage_active has_character_flag = cr_pilgrimage_returning }
	immediate = {
		cr_pilgrimage_find_companion_effect = yes
		cr_orthodox_find_rite_participants_effect = yes
	}

	option = {
		name = CR_ORTHODOX_PILGRIMAGE_20_A
		trigger = { event_target:cr_pilgrimage_companion = { cr_valid_intimacy_partner_trigger = yes } }
		event_target:cr_pilgrimage_companion = { save_event_target_as = cr_intimacy_partner }
		cr_resolve_contextual_intimacy_effect = yes
		clear_event_target = cr_intimacy_partner
		cr_gain_carnal_good_ending_trait_effect = yes
		piety = 100
		prestige = 100
		cr_pilgrimage_clear_journey_effect = yes
		cr_pilgrimage_clear_neglect_effect = yes
		cr_orthodox_clear_rite_participants_effect = yes
		ai_chance = { factor = 60 modifier = { factor = 1.5 trait = lustful } modifier = { factor = 0.5 trait = chaste } }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_20_B
		trigger = {
			event_target:cr_orthodox_rite_partner_1 = { cr_valid_intimacy_partner_trigger = yes }
			event_target:cr_orthodox_rite_partner_2 = { cr_valid_intimacy_partner_trigger = yes }
		}
		cr_orthodox_resolve_group_rite_effect = yes
		piety = 125
		prestige = 125
		cr_pilgrimage_clear_journey_effect = yes
		cr_pilgrimage_clear_neglect_effect = yes
		ai_chance = { factor = 30 modifier = { factor = 3 trait = lustful } modifier = { factor = 2 trait = exhibitionist } modifier = { factor = 0.25 trait = chaste } }
	}
	option = {
		name = CR_ORTHODOX_PILGRIMAGE_20_C
		cr_gain_humble_good_ending_trait_effect = yes
		piety = 100
		prestige = 100
		cr_pilgrimage_clear_journey_effect = yes
		cr_pilgrimage_clear_neglect_effect = yes
		cr_orthodox_clear_rite_participants_effect = yes
		ai_chance = { factor = 40 modifier = { factor = 2 trait = chaste } }
	}
}
